Release 10.1A: OpenEdge Development:
ADM and SmartObjects
Super procedures
All support code for an object type, other than the code in its primary include file, is in a separately compiled super procedure built as a structured
.pfile. For example, the super procedure for SmartDataViewers isviewer.p.During startup, the
.pfile is run and established as a super procedure for each of its SmartObjects running in that session. Its routines useTARGET-PROCEDUREto get the procedure handle of the appropriate SmartObject and can then get property values from that procedure to get handles or other data needed to act on behalf of the SmartObject. These SmartObjects can run any internal procedure or function implemented in one of the object’s super procedures as if it were implemented in the SmartObject itself. This allows these separately compiled procedure objects to do the following:For an overview of super procedures, see OpenEdge Development: Progress 4GL Handbook . For descriptions of super procedures and
TARGET-PROCEDURE, see OpenEdge Development: Progress 4GL Reference .Figure 5–1 illustrates this relationship.
Figure 5–1: Super procedures and master interactions
![]()
The
smart.pcode usesTARGET-PROCEDUREto reference the two masters. Formaster1.w, the xyz procedure in thesmart.psuper procedure is run becausemaster1.wdoes not have its own xyz procedure. Formaster2.w, its own xyz procedure is run and then, because it executesRUNSUPER, the xyz procedure insmart.palso is run.As this example illustrates, using super procedures to provide most of the support code for a SmartObject provides these advantages:
Each super procedure must define a
getpropnamefunction for each object property that can be retrieved from objects of that type and asetpropnamefunction for each settable property. For more information on these properties, see the "Get and set functions for object properties" section.Super procedures are not SmartObjects in themselves and are not directly seen or manipulated in the AppBuilder during application assembly. They do not have SmartLinks, nor do they have properties of their own.
The super procedures for SmartObjects are designed to be shared and stateless. This means a given super procedure such as
viewer.pis run only once in a session. No matter how many SmartDataViewers there are, each SmartDataViewer designates the same instance ofviewer.pas its super procedure. This means whenever a routine is invoked inviewer.pas a super procedure, it queries whatever properties of itsTARGET-PROCEDUREare needed for it to act. The next routine invoked inviewer.pis not assumed to come from the sameTARGET-PROCEDURE.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |